<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link
            href="http://libs.baidu.com/bootstrap/3.0.3/css/bootstrap.min.css"
            rel="stylesheet"
    />
</head>
<body>
输入天数：<input type="number"> <button>确认</button>
</body>
<script>
    var ipt = document.querySelector('input');
    var span = document.querySelector('span');
    var btn = document.querySelector('button');
    btn.onclick = function () {
        var temp = ipt.value;
        if(!temp){
            alert('请输入');
            return false
        } else {
            var temp_ = temp % 7;
            if(temp_ == 1 ){
                temp_ = '三'  //今天周二，过一天就是周三
            }
            if(temp_ == 2 ){
                temp_ = '四'
            }
            if(temp_ == 3 ){
                temp_ = '五'
            }
            if(temp_ == 4 ){
                temp_ = '六'
            }
            if(temp_ == 5 ){
                temp_ = '日'
            }
            if(temp_ == 6 ){
                temp_ = '一'
            }
            if(temp_ == 7 ){
                temp_ = '二'
            }
            alert(temp + '天后是星期'+temp_)
        }
    }
</script>
</html>